import os#导入os模块
file1=input('path')#输入路径
def statistic(path):
    size=0

    for file in os.listdir(path):
        current_path = os.path.join(path, file)  # 组装路径
        if os.path.isfile(current_path):#判断当前的file是否为文件
            size+=os.path.getsize(current_path)
        elif os.path.isdir(current_path):#判断file是否为目录
            statistic(current_path)
    return size

print(statistic(file1))